<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">渠道名称：</label>
                            <div class="col-sm-8">
                                <select id="channelid" name="channelid" class="form-control" type="text"></select>
                            </div>
                        </div>
                        <!-- <div class="form-group">
                             <label class="col-sm-3 control-label">sdkID：</label>
                             <div class="col-sm-8">
                                 <input id="sdkid" name="sdkid" class="form-control" type="text">
                             </div>
                         </div>-->
                        <div class="form-group">
                            <label class="col-sm-3 control-label">sdk名称：</label>
                            <div class="col-sm-8">
                                <input maxlength="50" id="sdkname" name="sdkname" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">sdk版本：</label>
                            <div class="col-sm-8">
                                <input onkeyup="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
                                       maxlength="15" id="sdkver" name="sdkver" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">sdk状态：</label>
                            <div class="col-sm-8">
                                <select id="sdktype" name="sdktype" class="form-control">
                                    <option value="1">正常</option>
                                    <option value="0">删除</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">描述：</label>
                            <div class="col-sm-8">
                                <input maxlength="150" id="sdkdes" name="sdkdes" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/appjs/market/sdk/add.js">
</script>
<script type="text/javascript" th:inline="javascript">
    $(function () {
        $.ajax({
            type: 'get',
            url: '/market/sdk/listAllChannel',
            dataType: 'json',
            success: function (datas) {//返回list数据并循环获取
                var select = $("#channelid");
                for (var i = 0; i < datas.length; i++) {
                    select.append("<option value='" + datas[i].channelId + "'>"
                        + datas[i].channelName + "</option>");
                }
                /* $('.selectpicker').selectpicker('val', '');
                 $('.selectpicker').selectpicker('refresh');*/
            }
        });
        /*   var siteMap =$("#id").val();
           // var siteMap = eval(aaaa);

           for (var j = 0; j < siteMap.length; j++) {

               $.each(siteMap[j], function (key, value) {

                   alert(key);

                   alert(value);

               });

           }*/
        /* var aa=
         var select = $("#slpk");
         for (var i = 0; i < datas.length; i++) {
             select.append("<option value='" + datas[i].ROAD_CODE + "'>"
                 + datas[i].ROAD_NAME + "</option>");
         }*/
    })


    /* $(".selectpicker").selectpicker({
         noneSelectedText: '请选择'
     });
     $(window).on('load', function () {
         $('.selectpicker').selectpicker('val', '');
         $('.selectpicker').selectpicker('refresh');
     });
     //下拉数据加载
     $.ajax({
         type: 'get',
         url: basePath + "/lictran/tranStation/loadRoadForTranStationDetail",
         dataType: 'json',
         success: function (datas) {//返回list数据并循环获取
             var select = $("#slpk");
             for (var i = 0; i < datas.length; i++) {
                 select.append("<option value='" + datas[i].ROAD_CODE + "'>"
                     + datas[i].ROAD_NAME + "</option>");
             }
             $('.selectpicker').selectpicker('val', '');
             $('.selectpicker').selectpicker('refresh');
         }
     });*/

</script>
</body>
</html>
